import request from '/shop/request';

export default {
	// 商品详情
	detail: (id, params = {}) =>
		request({
			url: '/api/goods/detail/' + id,
			method: 'GET',
			params,
			custom: {
				showLoading: false,
				showError: false,
			},
		}),

	detailActivity: (id, params = {}) =>
		request({
			url: `/api/goods/detail/activity/${id}`,
			method: 'GET',
			params,
			custom: {
				showLoading: false,
				showError: false,
			},
		}),
	// 商品列表
	list: (data) =>
		request({
			url: '/api/goods/search',
			method: 'POST',
			data,
			custom: {
				showLoading: false,
				showError: false,
			},
		}),

	// 商品查询
	ids: (data) =>
		request({
			url: '/api/goods/list/ids',
			method: 'POST',
			data,
			custom: {
				showLoading: false,
				showError: false,
			},
		}),

	// 商品评价列表
	comment: (id, params = {}) =>
		request({
			url: '/api/goods/comment/' + id,
			method: 'GET',
			params,
			custom: {
				showLoading: false,
				showError: false,
			},
		}),
	commentSearch: (data) =>
		request({
			url: '/api/goods/comment/search',
			method: 'POST',
			data,
			custom: {
				showLoading: false,
				showError: false,
			},
		}),
	// 商品评价类型
	getType: (id) =>
		request({
			url: '/api/goods/comment/types/' + id,
			method: 'GET',
			custom: {
				showLoading: false,
				showError: false,
			},
		}),
	// 活动商品查询
	// 商品查询
	activity: (params = {}) =>
		request({
			url: '/api/goods/goods/activity',
			method: 'GET',
			params,
			custom: {
				showLoading: false,
				showError: false,
			},
		}),
	activityList: (params = {}) =>
		request({
			url: '/api/goods/goods/activityList',
			method: 'GET',
			params,
		}),

	secKillActivity: (data) =>
		request({
			url: '/api/activity/listseckill/goodsids',
			method: 'POST',
			data,
			custom: {
				showLoading: false,
				showError: false,
			},
		}),
	groupOnActivity: (data) =>
		request({
			url: '/api/activity/listgroupon/goodsids',
			method: 'POST',
			data,
			custom: {
				showLoading: false,
				showError: false,
			},
		}),
};
